#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<string.h>


int main()
{
	char arr[100] = { 0 };
	scanf("%s", arr);
	int len = strlen(arr), i = 0;
	for (i = 0; i < len; i++)
	{
		if (arr[i] >= 'a' && arr[i] <= 'z')
			arr[i] -= 32;
		else if (arr[i] >= 'A' && arr[i] <= 'Z')
			arr[i] += 32;
	}
	puts(arr);
	return 0;
}